package ui;

import com.sun.lwuit.*;
import com.sun.lwuit.layouts.BorderLayout;
import com.sun.lwuit.layouts.BoxLayout;
import com.sun.lwuit.list.*;


/**
 * Retired, use DefaultListCellRenderer
 *
 * @author Meera
 */
public class WeekDayListRenderer extends Container implements ListCellRenderer {

    private Label item = new Label("");
    private DefaultListCellRenderer selectedRenderer = new DefaultListCellRenderer(false);

    public WeekDayListRenderer() {
        setLayout(new BorderLayout());
        Container cnt = new Container(new BoxLayout(BoxLayout.Y_AXIS));

        item.getStyle().setBgTransparency(0);
        cnt.addComponent(item);
        addComponent(BorderLayout.WEST, cnt);
    }

    public Component getListCellRendererComponent(List list, Object value, int index, boolean isSelected) {
        item.setText((String) value);
        if (isSelected) {
            //selIndexFlag = true;

            selectedRenderer.getListCellRendererComponent(list, value, index, isSelected);
            return selectedRenderer;
        } else {
            // list.putClientProperty("List.isFileList", Boolean.TRUE);
            //selIndexFlag = false;

            return item;
        }

    }

    public Component getListFocusComponent(List list) {
        return item;
    }
}
